import { Button, Image, Divider } from 'antd';
import useBoolean from 'hooks/useBoolean';

export default function UseBoolean() {
  const [bool, { setTrue, setFalse, setToggle }] = useBoolean(false);
  return (
    <>
      <Button onClick={setTrue}>显示</Button>
      <Button onClick={setFalse}>隐藏</Button>
      <Button onClick={setToggle}>切换</Button>
      <Divider></Divider>
      {bool && (
        <Image
          width={200}
          src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
        />
      )}
    </>
  );
}
